



import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';


main()=> runApp(CLMyapp());

class CLMyapp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
        home: CLbody()
    );
  }
}


class CLbody extends StatelessWidget{

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return
      Scaffold(
        appBar: AppBar(
          title:Text("按钮") ,
        ),
        body:  CLbodycontent(),



      );
  }
}
class CLbodycontent extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _CLbodycontentState();
  }
}

class _CLbodycontentState extends State<CLbodycontent> {
  final imageURL = "https://img1.baidu.com/it/u=211652494,2598660937&fm=26&fmt=auto";
  var _isFave=false;
  @override
  Widget build(BuildContext context) {
    return Stack(
        children:[
          Image.asset("assets/images/a.jpg"),
          Positioned(
            left: 0,
            right: 0,
            bottom: 0,
            child: Container(
              padding: EdgeInsets.symmetric(horizontal: 8),
              color: Color.fromARGB(150, 0, 0, 0),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text("hshs",style: TextStyle(color: Colors.white),),
                  IconButton(onPressed: (){
                    setState(() {
                      _isFave=!_isFave;
                    });
                  },
                    icon:Icon(Icons.favorite),color:_isFave? Colors.white:Colors.red, )
                ],
              ),
            ),
          )
        ]

    )

    ;
  }
}
